package com.gxa.modules.mapper;

import com.gxa.modules.pojo.Order;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @Auth WK
 * @DATE 2022/9/13 15:30
 * @DESCRIBE
 */
@Repository
public interface OrderMapper {

    /**
     * 1.订单列表查询
     * @param statusDelect
     * @return
     */
    int findCountOfOrder(@Param("statusDelect") Integer statusDelect);

    List<Map> findOrderList(@Param("start") Integer start, @Param("off") Integer off, @Param("statusDelect") Integer statusDelect);

    /**
     * 2.订单审核
     * @param orderId
     * @param status_audit
     * @return
     */
    int checkOrder(@Param("orderId") Integer orderId, @Param("status_audit") Integer status_audit);

    /**
     * 3.订单修改
     * @param order
     * @return
     */
    int updateOrder(Order order);

    /**
     * 4.订单作废
     * @param orderId
     * @param statusDelect
     * @return
     */
    int delectOrder(@Param("orderId") Integer orderId, @Param("statusDelect") Integer statusDelect);

    /**
     *  5.查看订单详情
     * @param orderId
     * @return
     */
    Order findOrder(@Param("orderId") Integer orderId);

    /**
     * 6.条件查询订单
     * @param customerName
     * @param status
     * @param payTime
     * @param start
     * @param off
     * @param statusDelect
     * @return
     */
    List<Order> findOrderByCondition(@Param("customerName") String customerName, @Param("status") Integer status, @Param("payTime") String payTime, @Param("start") Integer start, @Param("off") Integer off, @Param("statusDelect") Integer statusDelect);

    int findCountOfOrderByCondition(@Param("customerName") String customerName, @Param("status") Integer status, @Param("payTime") String payTime, @Param("statusDelect") Integer statusDelect);
}
